<script setup>
import { useRouter } from 'vue-router'
const router = useRouter()

const toPage = page => {
  router.push(page)
}
</script>

<template>
  <div>首页</div>
  <hr />
  <div>
    <a href="/about">关于</a>
  </div>

  <hr />
  <div>
    <span @click="toPage('/about')">关于</span>
  </div>

  <hr />
  <div @click="toPage('/test')">首页测试</div>
</template>
